package com.chaihu.jpaDemo.common.util;

import java.util.Date;
import java.util.Locale;

import org.apache.commons.lang3.time.FastDateFormat;

/**
 * 
 * Create By qinzhw
 * 2018年4月12日下午6:41:30
 */
public class DateUtil {
	/**
	 * 中文日期 yyyy-MM-dd E
	 */
	private static String YYYY_MM_DD_E = "yyyy-MM-dd E";

	/**
	 * yyyy-MM-dd
	 */
	private static String YYYY_MM_DD = "yyyy-MM-dd";
	/**
	 * yyyyMMdd
	 */
	private static String yyyy_mm_dd = "yyyyMMdd";

	/**
	 * yyyy-MM-dd HH:mm:ss
	 */
	private static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
	/**
	 * yyyy-MM-dd HH:mm
	 */
	private static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
	/**
	 * yyyyMMddHHmm
	 */
	private static String yyyy_mm_dd_hh_mm = "yyyyMMddHHmm";
	/**
	 * HH:mm
	 */
	private static String HH_MM = "HH:mm";
	/**
	 * HHmm
	 */
	private static String hh_mm = "HHmm";

	/**
	 * MMddHHmmss
	 */
	private static String mm_dd_hh_mm_ss = "MMddHHmmss";

	public static FastDateFormat YYYYMMDDE() {
		FastDateFormat faseDF = FastDateFormat.getInstance(YYYY_MM_DD_E, Locale.CHINESE);
		return faseDF;
	}

	public static FastDateFormat YYYYMMDD() {
		FastDateFormat faseDF = FastDateFormat.getInstance(YYYY_MM_DD);
		return faseDF;
	}

	public static FastDateFormat yyyymmdd() {
		FastDateFormat faseDF = FastDateFormat.getInstance(yyyy_mm_dd);
		return faseDF;
	}

	public static FastDateFormat YYYYMMDDHHMMSS() {
		FastDateFormat faseDF = FastDateFormat.getInstance(YYYY_MM_DD_HH_MM_SS);
		return faseDF;
	}

	public static FastDateFormat YYYYMMDDHHMM() {
		FastDateFormat faseDF = FastDateFormat.getInstance(YYYY_MM_DD_HH_MM);
		return faseDF;
	}

	public static FastDateFormat yyyymmddhhmm() {
		FastDateFormat faseDF = FastDateFormat.getInstance(yyyy_mm_dd_hh_mm);
		return faseDF;
	}

	public static FastDateFormat HHMM() {
		FastDateFormat faseDF = FastDateFormat.getInstance(HH_MM);
		return faseDF;
	}

	public static FastDateFormat hhmm() {
		FastDateFormat faseDF = FastDateFormat.getInstance(hh_mm);
		return faseDF;
	}

	public static FastDateFormat mmddhhmmss() {
		FastDateFormat faseDF = FastDateFormat.getInstance(mm_dd_hh_mm_ss);
		return faseDF;
	}

	public static String getNowYYYYMMDDHHMMSS() {
		return FastDateFormat.getInstance(YYYY_MM_DD_HH_MM_SS).format(new Date());
	}

	public static String getNowYYYYMMDDHHMM() {
		return FastDateFormat.getInstance(YYYY_MM_DD_HH_MM).format(new Date());
	}

	public static String getNowYYYYMMDD() {
		return FastDateFormat.getInstance(YYYY_MM_DD).format(new Date());
	}

}
